package com.bwie.controller;

import com.bwie.common.domain.User;
import com.bwie.common.result.Result;
import com.bwie.service.UserService;
import kotlin.coroutines.RestrictsSuspension;
import lombok.extern.log4j.Log4j2;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Author：ShenJiaFeng
 * @Package：com.bwie.controller
 * @Project：zg6_yuekao
 * @name：UserController
 * @Date：2024/5/17 9:41
 */
@RestController
@RequestMapping("/user")
@Log4j2
public class UserController {
    @Autowired
    private UserService userService;

    @PostMapping("/findByPhone")
    public Result<User> findByPhone(@RequestParam String phone){
        return Result.success(
                userService.findByPhone(phone)
        );
    }

}
